package com.mark.enums;

/**
 * Created by Mark on 2018/3/30.
 * 支付方式的枚举类
 */
public enum PaymentTypeEnum {
    ONLINE_PAY(1,"在线支付");

    private  int code;
    private  String information;
    PaymentTypeEnum(int code, String information) {
        this.code = code;
        this.information = information;
    }

    public static PaymentTypeEnum CodeOf(int code){
        for (PaymentTypeEnum paymentTypeEnum:values()){
            if(paymentTypeEnum.getCode()==code){
                return paymentTypeEnum;
            }
        }
        throw new RuntimeException("没有有找到对应的枚举");
    }
    public int getCode() {
        return code;
    }

    public String getInformation() {
        return information;
    }
}
